package rest;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;


/**
 * Created by Administrator on 2017/9/28.
 */
public class HttpClientFacoty     {

    public static RestHighLevelClient getInstance() throws Exception{
        RestClient restClient = RestClient.builder(
                new HttpHost("localhost", 9200, "http"),
                new HttpHost("localhost", 9201, "http")).build();

        //high level
        RestHighLevelClient client =
                new RestHighLevelClient(restClient);
        return client;
    }



}
